home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 0769B.ZIP / DEMOSCR2.PRG < prev    next >
Text File  |  1987-10-23  |  3KB  |  72 lines

  1. * clipscrn.prg  dBIII jjo Start 10-24-85 Last Update 10-23-87
  2. * library of functions added to clipper
  3.  
  4. * Functions not in dBASE III or Clipper
  5. * CLEARBOX()  : Clear Inside Box Between Top x,y TO Bottom x,y
  6. *             :    And Fill With Attribute Color
  7. * ROLLDN()    : Rolls Down Box Between Top x,y TO Bottom x,y
  8. *             :    One Line And Fill With Attribute Color
  9. * ROLLUP()    : Rolls Up Box Between Top x,y TO Bottom x,y
  10. *             :    One Line And Fill With Attribute Color
  11. * COLOR2NM()  : Converts Color Letters To Numeric Form For
  12. *             :    Use With Above 3 UDFs
  13. *             : Will Only Work With GRB combinations, W, N, and + 
  14. *             : Cannot Read Clipper Background Attribute From System
  15. *             : And Cannot Interpret Backslash Such As GR+/B
  16.  
  17. *****************************************
  18. * Functions Not In dBASE III Or Clipper *
  19. *****************************************
  20.  
  21. FUNCTION CLEARBOX
  22.    * Syntax: CLEARBOX( <expN1>, <expN2> , <expN3>, <expN4>, <expC5>)
  23.    * Return: Clear inside of box from top x,y coordinates
  24.    * to bottom x,y coordinates and fills with attribute color
  25.    * for background
  26.    PARAMETER cl_topx,cl_topy,cl_botx,cl_boty,cl_attr
  27.    PRIVATE cl_attrno
  28.    cl_attrno = IIF(PCOUNT() = 4, 0, COLOR2NM(cl_attr))
  29.    CALL BOXCLS WITH cl_topx,cl_topy,cl_botx,cl_boty, cl_attrno, 0, 6
  30. RETURN ("")
  31.  
  32. FUNCTION ROLLDN
  33.    * Syntax: CLEARBOX( <expN1>, <expN2> , <expN3>, <expN4>, <expC5>)
  34.    * Return: Rolls box down from top x,y coordinates to
  35.    * bottom x,y coordinates and fills with attribute color
  36.    * for background
  37.    PARAMETER cl_topx,cl_topy,cl_botx,cl_boty,cl_attr
  38.    PRIVATE cl_attrno
  39.    cl_attrno = IIF(PCOUNT() = 4, 0, COLOR2NM(cl_attr))
  40.    CALL BOXCLS WITH cl_topx,cl_topy,cl_botx,cl_boty, cl_attrno, 1, 7
  41. RETURN ("")
  42.  
  43. FUNCTION ROLLUP
  44.    * Syntax: CLEARBOX( <expN1>, <expN2> , <expN3>, <expN4>, <expC5>)
  45.    * Return: Rolls box up from top x,y coordinates to
  46.    * bottom x,y coordinates and fills with attribute color
  47.    * for background
  48.    PARAMETER cl_topx,cl_topy,cl_botx,cl_boty,cl_attrno
  49.    PRIVATE cl_attrno
  50.    cl_attrno = IIF(PCOUNT() = 4, 0, COLOR2NM(cl_attr))
  51.    CALL BOXCLS WITH cl_topx,cl_topy,cl_botx,cl_boty, cl_attrno, 1, 6
  52. RETURN ("")
  53.  
  54. FUNCTION COLOR2NM
  55.    * Syntax: COLOR2NM( <expC>
  56.    * Return: Numeric Form Of Typical Clipper Numbers
  57.    * eg. COLOR2NM("BG") would return 3 as attribute color
  58.    * for conversion for above UDFs
  59.    PARAMETER cl_ltr
  60.    PRIVATE color_num
  61.    cl_ltr = UPPER(cl_ltr)
  62.    color_num = 0
  63.    color_num = IIF("B" $ cl_ltr, color_num + 1, color_num)
  64.    color_num = IIF("G" $ cl_ltr, color_num + 2, color_num)
  65.    color_num = IIF("R" $ cl_ltr, color_num + 4, color_num)
  66.    color_num = IIF("W" $ cl_ltr, 7            , color_num)
  67.    color_num = IIF("N" $ cl_ltr, 0            , color_num)
  68.    color_num = IIF("+" $ cl_ltr, color_num + 8, color_num)
  69. RETURN(color_num)
  70.  
  71. * eof clipscrn.prg
  72.